//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
//
// (C) Copyright 2006 Marvell International Ltd.
// All Rights Reserved
//

// This file describes the stub battery interface.  It is only intended
// for use on systems without real batteries, for prototyping battery-
// sensitive software.

#pragma once

#ifdef __cplusplus
extern "C" {
#endif  /* __cplusplus */

#pragma pack(4)
typedef struct _BatteryStatus_tag {
    SYSTEM_POWER_STATUS_EX2 sps;
    WORD    wMainLevels;
    WORD    wBackupLevels;
    BOOL    fSupportsChange;
    BOOL    fChanged;
} BATTERY_STATUS, *PBATTERY_STATUS;
#pragma pack()

#define BATTERY_STATUS_FILE TEXT("Battery File")
#define BATTERY_FILE_MUTEX  TEXT("Battery File Mutex")

// OEM battry driver functions for the specific battery manufacturer
typedef BOOL (*OEMBatteryInit_t)();
typedef BOOL (*OEMBatterySleepModeEnable_t)();
typedef BOOL (*OEMDetectBattery_t)();
typedef BOOL (*OEMGetBatteryLifePercent_t)(BYTE *pLifePercent);
typedef BOOL (*OEMGetBatteryVoltage_t)(DWORD *pVoltage);
typedef BOOL (*OEMGetBatteryCurrent_t)(INT *pCurrent);
typedef BOOL (*OEMGetBatteryTemperature_t)(DWORD *pTemperature);
typedef BOOL (*OEMCheckChargerState_t)();
typedef BOOL (*OEMCheckACState_t)();
typedef void (*OEMDeInit_t)();

typedef struct _OEMBatteryRoutines {
	OEMBatteryInit_t			OEMBatteryInit;
	OEMBatterySleepModeEnable_t	OEMBatterySleepModeEnable;
	OEMDetectBattery_t			OEMDetectBattery;	
	OEMGetBatteryLifePercent_t	OEMGetBatteryLifePercent;
	OEMGetBatteryVoltage_t		OEMGetBatteryVoltage;
	OEMGetBatteryCurrent_t		OEMGetBatteryCurrent;
	OEMGetBatteryTemperature_t	OEMGetBatteryTemperature;
	OEMCheckChargerState_t		OEMCheckChargerState;
	OEMCheckACState_t		      OEMCheckACState;
	OEMDeInit_t					OEMDeInit;
}OEM_BATTERYROUTINES, *POEM_BATTERYROUTINES;

extern OEM_BATTERYROUTINES gOEMBatteryRoutines;

#ifdef __cplusplus
}
#endif  /* __cplusplus */

